<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="170px">
      <el-form-item label="外键，电子档案案卷表" prop="eaid">
        <el-input
          v-model="queryParams.eaid"
          placeholder="请输入外键，电子档案案卷表"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="外键，案卷级档案表，实体档案室按照实体档案进行重新组卷时生成" prop="aid">
        <el-input
          v-model="queryParams.aid"
          placeholder="请输入外键，案卷级档案表，实体档案室按照实体档案进行重新组卷时生成"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件名，数字化部输入" prop="wenJianName">
        <el-input
          v-model="queryParams.wenJianName"
          placeholder="请输入文件名，数字化部输入"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件数，数字化部输入，案卷包含的文件个数" prop="pageShu">
        <el-input
          v-model="queryParams.pageShu"
          placeholder="请输入文件数，数字化部输入，案卷包含的文件个数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件目录，文件存入服务器自动生成" prop="fileDirectory">
        <el-input
          v-model="queryParams.fileDirectory"
          placeholder="请输入文件目录，文件存入服务器自动生成"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="状态值 0：表示未被绑定  1：表示已被绑定" prop="state">
        <el-input
          v-model="queryParams.state"
          placeholder="请输入状态值 0：表示未被绑定  1：表示已被绑定"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="creationTime">
        <el-date-picker clearable
          v-model="queryParams.creationTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="文件id" prop="fileId">
        <el-input
          v-model="queryParams.fileId"
          placeholder="请输入文件id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件编号" prop="efilenum">
        <el-input
          v-model="queryParams.efilenum"
          placeholder="请输入文件编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="listnum">
        <el-input
          v-model="queryParams.listnum"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="列表号" prop="listId">
        <el-input
          v-model="queryParams.listId"
          placeholder="请输入列表号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="索引id" prop="indexId">
        <el-input
          v-model="queryParams.indexId"
          placeholder="请输入索引id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="案卷ID" prop="volumeid">
        <el-input
          v-model="queryParams.volumeid"
          placeholder="请输入案卷ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="旧案卷ID" prop="oldvolumeid">
        <el-input
          v-model="queryParams.oldvolumeid"
          placeholder="请输入旧案卷ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件题名" prop="filename">
        <el-input
          v-model="queryParams.filename"
          placeholder="请输入文件题名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="责任者" prop="duty">
        <el-input
          v-model="queryParams.duty"
          placeholder="请输入责任者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件编号" prop="tagnum">
        <el-input
          v-model="queryParams.tagnum"
          placeholder="请输入文件编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="filenum">
        <el-input
          v-model="queryParams.filenum"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="主题词" prop="thematic">
        <el-input
          v-model="queryParams.thematic"
          placeholder="请输入主题词"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="ctime">
        <el-date-picker clearable
          v-model="queryParams.ctime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="页数" prop="pagenumber">
        <el-input
          v-model="queryParams.pagenumber"
          placeholder="请输入页数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="密级" prop="securitylayer">
        <el-input
          v-model="queryParams.securitylayer"
          placeholder="请输入密级"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="保存期限" prop="savetime">
        <el-input
          v-model="queryParams.savetime"
          placeholder="请输入保存期限"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件时间" prop="filetime">
        <el-date-picker clearable
          v-model="queryParams.filetime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择文件时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="文件号" prop="fileno">
        <el-input
          v-model="queryParams.fileno"
          placeholder="请输入文件号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="附件" prop="fileatt">
        <el-input
          v-model="queryParams.fileatt"
          placeholder="请输入附件"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件总数量" prop="totalnum">
        <el-input
          v-model="queryParams.totalnum"
          placeholder="请输入文件总数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="总数量" prop="total">
        <el-input
          v-model="queryParams.total"
          placeholder="请输入总数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="建设单位" prop="buildorganization">
        <el-input
          v-model="queryParams.buildorganization"
          placeholder="请输入建设单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="编制单位" prop="wcompanyId">
        <el-input
          v-model="queryParams.wcompanyId"
          placeholder="请输入编制单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="档号" prop="vnum">
        <el-input
          v-model="queryParams.vnum"
          placeholder="请输入档号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否归档" prop="isArchived">
        <el-input
          v-model="queryParams.isArchived"
          placeholder="请输入是否归档"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目索引" prop="projIndex">
        <el-input
          v-model="queryParams.projIndex"
          placeholder="请输入项目索引"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="附注" prop="comments">
        <el-input
          v-model="queryParams.comments"
          placeholder="请输入附注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="摘要" prop="abstracts">
        <el-input
          v-model="queryParams.abstracts"
          placeholder="请输入摘要"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="关键字" prop="keywords">
        <el-input
          v-model="queryParams.keywords"
          placeholder="请输入关键字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="电子文件存放路径" prop="filepath">
        <el-input
          v-model="queryParams.filepath"
          placeholder="请输入电子文件存放路径"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件信息预留1" prop="fileReserved1">
        <el-input
          v-model="queryParams.fileReserved1"
          placeholder="请输入文件信息预留1"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="fileReserved2">
        <el-input
          v-model="queryParams.fileReserved2"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:affile:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:affile:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:affile:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:affile:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="affileList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="主键,自动生成" align="center" prop="id" />
      <el-table-column label="外键，电子档案案卷表" align="center" prop="eaid" />
      <el-table-column label="外键，案卷级档案表，实体档案室按照实体档案进行重新组卷时生成" align="center" prop="aid" />
      <el-table-column label="文件名，数字化部输入" align="center" prop="wenJianName" />
      <el-table-column label="文件数，数字化部输入，案卷包含的文件个数" align="center" prop="pageShu" />
      <el-table-column label="文件目录，文件存入服务器自动生成" align="center" prop="fileDirectory" />
      <el-table-column label="状态值 0：表示未被绑定  1：表示已被绑定" align="center" prop="state" />
      <el-table-column label="创建时间" align="center" prop="creationTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.creationTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="文件id" align="center" prop="fileId" />
      <el-table-column label="文件编号" align="center" prop="efilenum" />
      <el-table-column label="${comment}" align="center" prop="listnum" />
      <el-table-column label="列表号" align="center" prop="listId" />
      <el-table-column label="索引id" align="center" prop="indexId" />
      <el-table-column label="案卷ID" align="center" prop="volumeid" />
      <el-table-column label="旧案卷ID" align="center" prop="oldvolumeid" />
      <el-table-column label="文件题名" align="center" prop="filename" />
      <el-table-column label="责任者" align="center" prop="duty" />
      <el-table-column label="文件编号" align="center" prop="tagnum" />
      <el-table-column label="${comment}" align="center" prop="filenum" />
      <el-table-column label="主题词" align="center" prop="thematic" />
      <el-table-column label="创建时间" align="center" prop="ctime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.ctime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="页数" align="center" prop="pagenumber" />
      <el-table-column label="密级" align="center" prop="securitylayer" />
      <el-table-column label="文件类型" align="center" prop="filetype" />
      <el-table-column label="保存期限" align="center" prop="savetime" />
      <el-table-column label="文件时间" align="center" prop="filetime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.filetime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="文件号" align="center" prop="fileno" />
      <el-table-column label="附件" align="center" prop="fileatt" />
      <el-table-column label="载体类型" align="center" prop="carriertype" />
      <el-table-column label="文件总数量" align="center" prop="totalnum" />
      <el-table-column label="总数量" align="center" prop="total" />
      <el-table-column label="纸张类型" align="center" prop="papertype" />
      <el-table-column label="建设单位" align="center" prop="buildorganization" />
      <el-table-column label="编制单位" align="center" prop="wcompanyId" />
      <el-table-column label="档号" align="center" prop="vnum" />
      <el-table-column label="是否归档" align="center" prop="isArchived" />
      <el-table-column label="项目索引" align="center" prop="projIndex" />
      <el-table-column label="附注" align="center" prop="comments" />
      <el-table-column label="摘要" align="center" prop="abstracts" />
      <el-table-column label="关键字" align="center" prop="keywords" />
      <el-table-column label="电子文件存放路径" align="center" prop="filepath" />
      <el-table-column label="文件信息预留1" align="center" prop="fileReserved1" />
      <el-table-column label="${comment}" align="center" prop="fileReserved2" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:affile:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:affile:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改文件管理审核后对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="外键，电子档案案卷表" prop="eaid">
          <el-input v-model="form.eaid" placeholder="请输入外键，电子档案案卷表" />
        </el-form-item>
        <el-form-item label="外键，案卷级档案表，实体档案室按照实体档案进行重新组卷时生成" prop="aid">
          <el-input v-model="form.aid" placeholder="请输入外键，案卷级档案表，实体档案室按照实体档案进行重新组卷时生成" />
        </el-form-item>
        <el-form-item label="文件名，数字化部输入" prop="wenJianName">
          <el-input v-model="form.wenJianName" placeholder="请输入文件名，数字化部输入" />
        </el-form-item>
        <el-form-item label="文件数，数字化部输入，案卷包含的文件个数" prop="pageShu">
          <el-input v-model="form.pageShu" placeholder="请输入文件数，数字化部输入，案卷包含的文件个数" />
        </el-form-item>
        <el-form-item label="文件目录，文件存入服务器自动生成" prop="fileDirectory">
          <el-input v-model="form.fileDirectory" placeholder="请输入文件目录，文件存入服务器自动生成" />
        </el-form-item>
        <el-form-item label="状态值 0：表示未被绑定  1：表示已被绑定" prop="state">
          <el-input v-model="form.state" placeholder="请输入状态值 0：表示未被绑定  1：表示已被绑定" />
        </el-form-item>
        <el-form-item label="创建时间" prop="creationTime">
          <el-date-picker clearable
            v-model="form.creationTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择创建时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="文件id" prop="fileId">
          <el-input v-model="form.fileId" placeholder="请输入文件id" />
        </el-form-item>
        <el-form-item label="文件编号" prop="efilenum">
          <el-input v-model="form.efilenum" placeholder="请输入文件编号" />
        </el-form-item>
        <el-form-item label="${comment}" prop="listnum">
          <el-input v-model="form.listnum" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="列表号" prop="listId">
          <el-input v-model="form.listId" placeholder="请输入列表号" />
        </el-form-item>
        <el-form-item label="索引id" prop="indexId">
          <el-input v-model="form.indexId" placeholder="请输入索引id" />
        </el-form-item>
        <el-form-item label="案卷ID" prop="volumeid">
          <el-input v-model="form.volumeid" placeholder="请输入案卷ID" />
        </el-form-item>
        <el-form-item label="旧案卷ID" prop="oldvolumeid">
          <el-input v-model="form.oldvolumeid" placeholder="请输入旧案卷ID" />
        </el-form-item>
        <el-form-item label="文件题名" prop="filename">
          <el-input v-model="form.filename" placeholder="请输入文件题名" />
        </el-form-item>
        <el-form-item label="责任者" prop="duty">
          <el-input v-model="form.duty" placeholder="请输入责任者" />
        </el-form-item>
        <el-form-item label="文件编号" prop="tagnum">
          <el-input v-model="form.tagnum" placeholder="请输入文件编号" />
        </el-form-item>
        <el-form-item label="${comment}" prop="filenum">
          <el-input v-model="form.filenum" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="主题词" prop="thematic">
          <el-input v-model="form.thematic" placeholder="请输入主题词" />
        </el-form-item>
        <el-form-item label="创建时间" prop="ctime">
          <el-date-picker clearable
            v-model="form.ctime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择创建时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="页数" prop="pagenumber">
          <el-input v-model="form.pagenumber" placeholder="请输入页数" />
        </el-form-item>
        <el-form-item label="密级" prop="securitylayer">
          <el-input v-model="form.securitylayer" placeholder="请输入密级" />
        </el-form-item>
        <el-form-item label="保存期限" prop="savetime">
          <el-input v-model="form.savetime" placeholder="请输入保存期限" />
        </el-form-item>
        <el-form-item label="文件时间" prop="filetime">
          <el-date-picker clearable
            v-model="form.filetime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择文件时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="文件号" prop="fileno">
          <el-input v-model="form.fileno" placeholder="请输入文件号" />
        </el-form-item>
        <el-form-item label="附件" prop="fileatt">
          <el-input v-model="form.fileatt" placeholder="请输入附件" />
        </el-form-item>
        <el-form-item label="文件总数量" prop="totalnum">
          <el-input v-model="form.totalnum" placeholder="请输入文件总数量" />
        </el-form-item>
        <el-form-item label="总数量" prop="total">
          <el-input v-model="form.total" placeholder="请输入总数量" />
        </el-form-item>
        <el-form-item label="建设单位" prop="buildorganization">
          <el-input v-model="form.buildorganization" placeholder="请输入建设单位" />
        </el-form-item>
        <el-form-item label="编制单位" prop="wcompanyId">
          <el-input v-model="form.wcompanyId" placeholder="请输入编制单位" />
        </el-form-item>
        <el-form-item label="档号" prop="vnum">
          <el-input v-model="form.vnum" placeholder="请输入档号" />
        </el-form-item>
        <el-form-item label="是否归档" prop="isArchived">
          <el-input v-model="form.isArchived" placeholder="请输入是否归档" />
        </el-form-item>
        <el-form-item label="项目索引" prop="projIndex">
          <el-input v-model="form.projIndex" placeholder="请输入项目索引" />
        </el-form-item>
        <el-form-item label="附注" prop="comments">
          <el-input v-model="form.comments" placeholder="请输入附注" />
        </el-form-item>
        <el-form-item label="摘要" prop="abstracts">
          <el-input v-model="form.abstracts" placeholder="请输入摘要" />
        </el-form-item>
        <el-form-item label="关键字" prop="keywords">
          <el-input v-model="form.keywords" placeholder="请输入关键字" />
        </el-form-item>
        <el-form-item label="电子文件存放路径" prop="filepath">
          <el-input v-model="form.filepath" placeholder="请输入电子文件存放路径" />
        </el-form-item>
        <el-form-item label="文件信息预留1" prop="fileReserved1">
          <el-input v-model="form.fileReserved1" placeholder="请输入文件信息预留1" />
        </el-form-item>
        <el-form-item label="${comment}" prop="fileReserved2">
          <el-input v-model="form.fileReserved2" placeholder="请输入${comment}" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listAffile, getAffile, delAffile, addAffile, updateAffile } from "@/api/system/affile";

export default {
  name: "Affile",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 文件管理审核后表格数据
      affileList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        eaid: null,
        aid: null,
        wenJianName: null,
        pageShu: null,
        fileDirectory: null,
        state: null,
        creationTime: null,
        fileId: null,
        efilenum: null,
        listnum: null,
        listId: null,
        indexId: null,
        volumeid: null,
        oldvolumeid: null,
        filename: null,
        duty: null,
        tagnum: null,
        filenum: null,
        thematic: null,
        ctime: null,
        pagenumber: null,
        securitylayer: null,
        filetype: null,
        savetime: null,
        filetime: null,
        fileno: null,
        fileatt: null,
        carriertype: null,
        totalnum: null,
        total: null,
        papertype: null,
        buildorganization: null,
        wcompanyId: null,
        vnum: null,
        isArchived: null,
        projIndex: null,
        comments: null,
        abstracts: null,
        keywords: null,
        filepath: null,
        fileReserved1: null,
        fileReserved2: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        eaid: [
          { required: true, message: "外键，电子档案案卷表不能为空", trigger: "blur" }
        ],
        isArchived: [
          { required: true, message: "是否归档不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询文件管理审核后列表 */
    getList() {
      this.loading = true;
      listAffile(this.queryParams).then(response => {
        this.affileList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        eaid: null,
        aid: null,
        wenJianName: null,
        pageShu: null,
        fileDirectory: null,
        state: null,
        creationTime: null,
        fileId: null,
        efilenum: null,
        listnum: null,
        listId: null,
        indexId: null,
        volumeid: null,
        oldvolumeid: null,
        filename: null,
        duty: null,
        tagnum: null,
        filenum: null,
        thematic: null,
        ctime: null,
        pagenumber: null,
        securitylayer: null,
        filetype: null,
        savetime: null,
        filetime: null,
        fileno: null,
        fileatt: null,
        carriertype: null,
        totalnum: null,
        total: null,
        papertype: null,
        buildorganization: null,
        wcompanyId: null,
        vnum: null,
        isArchived: null,
        projIndex: null,
        comments: null,
        abstracts: null,
        keywords: null,
        filepath: null,
        fileReserved1: null,
        fileReserved2: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加文件管理审核后";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getAffile(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改文件管理审核后";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateAffile(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addAffile(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除文件管理审核后编号为"' + ids + '"的数据项？').then(function() {
        return delAffile(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/affile/export', {
        ...this.queryParams
      }, `affile_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
